#include <stdio.h>
#include <iostream>
#include <thread>
#include <unistd.h>
#include <stdint.h>
using namespace std;

void cpu_press_test(uint64_t num)
{
    uint64_t i = 0;
    while (true)
    {
        while (i < num)
        {
            i++;
        }
        usleep(0.1 * 1000000);
    }
}

int main(void)
{
    int value = 42;
    std::thread thread0(cpu_press_test, 100000);
    std::thread thread1(cpu_press_test, 500000);

    // 等待线程完成
    thread0.join();
    thread1.join();

    // 输出修改后的变量值
    std::cout << "Modified variable value: " << value << std::endl;

    return 0;
}
